/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Mansur
 */
@Entity
@Table(name = "ship_visitcrew")
@NamedQueries({
    @NamedQuery(name = "ShipVisitCrew.findAll", query = "SELECT v FROM ShipVisitCrew v")})
public class ShipVisitCrew implements Serializable{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ship_visitcw_id")
    private Integer svCrewId;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_visitfl_id")
    private ShipVisitFlow shipVisitFlowId;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sv_desc_id")
    private ShipVisitDescription svDescId;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sv_comp_id")
    private ShipVisitCompliance svCompId;
    @Column(name = "remarks")
    private String remarks;
    
    @Embedded
    private InfoAudit infoAudit;
    
    public ShipVisitCrew(){
        
    }

    public Integer getSvCrewId() {
        return svCrewId;
    }

    public void setSvCrewId(Integer svCrewId) {
        this.svCrewId = svCrewId;
    }

    public ShipVisitFlow getShipVisitFlowId() {
        return shipVisitFlowId;
    }

    public void setShipVisitFlowId(ShipVisitFlow shipVisitFlowId) {
        this.shipVisitFlowId = shipVisitFlowId;
    }

    public ShipVisitDescription getSvDescId() {
        return svDescId;
    }

    public void setSvDescId(ShipVisitDescription svDescId) {
        this.svDescId = svDescId;
    }

    public ShipVisitCompliance getSvCompId() {
        return svCompId;
    }

    public void setSvCompId(ShipVisitCompliance svCompId) {
        this.svCompId = svCompId;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (svCrewId != null ? svCrewId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShipVisitCrew)) {
            return false;
        }
        ShipVisitCrew other = (ShipVisitCrew) object;
        if ((this.svCrewId == null && other.svCrewId != null) || (this.svCrewId != null && !this.svCrewId.equals(other.svCrewId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.ShipVisitCrew[ svCrewId=" + svCrewId + " ]";
    }
    
}
